import java.util.Random;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2023-10-11
 * Time：19:34
 */
public class TestDemo {
    public static void main(String[] args) {
        //猜数字游戏
        Scanner scan = new Scanner((System.in));
        Random random = new Random();
        int randNum = random.nextInt(100);//[0,100)
        while(true){
            System.out.println("请输入你要猜的数字：");
            int num = scan.nextInt();
            if (num < randNum) {
                System.out.println("猜小了！");
            } else if (num == randNum) {
                System.out.println("猜对了！");
                break;
            } else {
                System.out.println("猜大了！");
            }
        }
    }
    public static void main3(String[] args) {
        //System.in键盘读入数据
        Scanner scan = new Scanner(System.in);
        //读取一行
        String name = scan.nextLine();
        System.out.println(name);
    }
    public static void main2(String[] args) {
        for (int i = 0; i < 10; i++) {
            System.out.print(i + " ");
        }
    }
    public static void main1(String[] args) {
        int i = 1;
        while(i <= 100) {
            if(i % 3 != 0 || i % 5 !=0) {
                i++;
                continue;
            } else {
                System.out.println(i);
            }
            i++;
        }
    }
}
